package com.thon.service.system.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thon.dao.system.LinksDao;
import com.thon.dao.util.Page;
import com.thon.entity.system.Links;
import com.thon.service.system.LinksService;

@Service
@Transactional
public class LinksServiceImpl implements LinksService {

	@Autowired
	private LinksDao linksDao;	


	@Override
	public Links read(Integer id) {		
		
	    return linksDao.get(id);
	}

	@Override
	public String create(Links Links) {
		String msg = "success";		
		linksDao.save(Links);
		return msg;
	}

	@Override
	public String delete(Integer id) {
		String msg = "success";		
		linksDao.delete(id);
		return msg;
	}

	@Override
	public String update(Links Links) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<Links> readList() {
	
			return linksDao.readList();
	
	}

	@Override
	public Page<Links> readListPage(Integer pageNo, Integer pageSize) {
		Page<Links> page = new Page<Links>();
		page.setPageNo(pageNo);
		page.setPageSize(pageSize);
		page.desc("id");
		return linksDao.readListPage(page);
	}
	


}